$(function(){
    window.onload = function(){
        $.ajax({
            url:'http://localhost:3000/play/new',
            mothed:'get',
            success:function(res){               
                var str = '';
                var sdd = [];
                for(var i = 0; i < 3; i++){
                    sdd.push(res[i]);
                }
                $.each(sdd,function(index,item){
                    $.each(item,function(a,b){
                        str += 
                            "<li>"+
                            "<img src="+b.img+" width=250px>"+
                            "<p>"+b.description+"</p>"+
                            "<p class=text>"+b.text+"</p>"+
                            "<br>"+
                            "<p>"+
                                "<span class=price>"+b.price+"</span>"+
                                "<span class=zan>"+
                                    "<img src=../img/zan.png width=15px>"+ b.like+
                                    "<img src=../img/xinRedo.png width=15px>"+ b.words+
                                "</span>"+
                            "</p>"+
                        "</li>"
                    })
                
                })
                $('.new>ul').html(str);
            }
        })
    }
})
$('.click').click(function(){
    $('.center').css('height','1890px');
    $('.new').css('height','1610px');
    $('.click').hide();
})